Rust: Adjust the inferred type of string literals#19996
Conversation
e7ba741 to
d93e516
Compare
| { | ||
| let str1 = "bar"; | ||
| str2 = "foo".to_string() + &str1; // $ Source[rust/access-after-lifetime-ended]=str1 | ||
| str2 = "foo".to_string() + &str1; |
There was a problem hiding this comment.
I think it actually is still considered a source, but the results are excluded due to the restriction you linked to. And these inline expectations only show sources associated with results, as I understand it, hence it is now hidden.
In any case both results we lost here are spurious, so I'm happy with this.
3aa472c to
2a207f9
Compare
geoffw0
left a comment
There was a problem hiding this comment.
Changes LGTM. DCA is showing a rather surprising 21% analysis time regression!
| { | ||
| let str1 = "bar"; | ||
| str2 = "foo".to_string() + &str1; // $ Source[rust/access-after-lifetime-ended]=str1 | ||
| str2 = "foo".to_string() + &str1; |
There was a problem hiding this comment.
I think it actually is still considered a source, but the results are excluded due to the restriction you linked to. And these inline expectations only show sources associated with results, as I understand it, hence it is now hidden.
In any case both results we lost here are spurious, so I'm happy with this.
I have pushed another commit that should fix it. |
geoffw0
left a comment
There was a problem hiding this comment.
Thanks for the performance fix, this LGTM. :)
Adjusts the types from
strtype&str.